package com.zpark.security.distributed.uaa.dao;


import com.zpark.security.distributed.uaa.model.PermissionDto;
import com.zpark.security.distributed.uaa.model.UserDto;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;

/**
 * @PackageName: com.itheima.security.springboot.dao
 * @ClassName: IUserDao
 * @Description:
 * @author: RZS
 * @date: 2021/7/25  23:16
 */
public interface IUserDao extends Mapper<UserDto> {

    @Select("select * from t_permission where id in(" +
            "select permission_id from t_role_permission where role_id in(" +
            "select id from t_user_role where user_id=#{userId}))")
    List<PermissionDto> findPermissionsByUserId(String userId);// 根据用户id查询用户权限
}
